package com.ddy.test.boxiao;

import com.ddy.test.excel.ExcelUtils;

import java.util.List;

/**
 * Created by ddy on 2017/11/30.
 */
public class CardNo {
    public static void main(String[] args) throws Exception {
        convertCardNo();
    }

    //一卡通16进制转10进制
    public static void convertCardNo() throws Exception {
        List<List<String>> lists = ExcelUtils.readXlsx("***.xlsx","");
        for(List<String> rowList : lists){
            for(int colIx=0;colIx<rowList.size();colIx++){
                String cellVal = rowList.get(colIx);
                if(colIx == 0){
                    System.out.print("(null,'" + cellVal + "',");
                }
                if(colIx == 2){

                    long longValue = Long.parseLong(cellVal, 16);
                    if(longValue < 1000000000L){
                        System.out.println("'0" + longValue + "'),");
                    }else{
                        System.out.println("'" + longValue + "'),");
                    }
                }
            }
        }

    }
}
